package com.android.nearshop.io.protocol.in;

import org.json.JSONObject;

import android.util.Log;

/*********************************************************
 * @author : zhaohua
 * @version : 2012-9-13
 * @see : 添加用户的意见和建议
 * @Copyright : copyrights reserved by personal 2007-2011
 **********************************************************/
public class AddSuggestionAction extends SoapAction<Integer>
{
    // 1:成功
    public int result;
    
    /**
     * @param type
     * @param method
     */
    public AddSuggestionAction(String sugtitle, String recordername, 
            String recorderphone,String content)
    {
        super(ACTION_TYPE.ACTION_SYSTEM, "addSuggestion");
        addJsonParam("sugtitle", sugtitle);
        addJsonParam("recordername", recordername);
        addJsonParam("recorderphone",recorderphone);
        addJsonParam("content", content);
    }
    
    @Override
    protected Integer parseJson(String response) throws Exception
    {
        Log.d(getMethod(), getMethod() + "response: \n " + response);
        JSONObject res = new JSONObject(response);
        return res.getInt("result");
    }
}
